var currentPosition = null,timer = null;

$(document).ready(function(){
    if (typeof init === 'function')
    {
        init();
    }

	//top滚动
	$("#sideTop").click(GoTop);
})

function js2json(data)
{
    return eval("("+data+")");
}

function GoTop()
{
    timer=setInterval("runToTop()",1);
}

function runToTop(){
    currentPosition=document.documentElement.scrollTop || document.body.scrollTop;
    currentPosition-=10;
    if(currentPosition>0)
    {
        window.scrollTo(0,currentPosition);
    }
    else
    {
        window.scrollTo(0,0);
        clearInterval(timer);
    }
}